package cn.dc406.labc406mgr.mapper;

import cn.dc406.labc406mgr.entity.Items;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ItemsWapper {
    @Select("select * from items")
    List<Items> SelectAll();

    @Select("select * from items where id=#{id}")
    List<Items> selectbyID(int id);

    @Select("select * from items where name=#{name}")
    List<Items> selectbyName(String name);

    @Update("update items set name=#{name},guige=#{guige},xinghao=#{xinghao},beizhu=#{beizhu},amount=#{amount} where id=#{id}")
    Boolean UpdateItem(Items items);

    @Delete("delete from items where id=#{id}")
    Boolean deleteItem(int id);

    @Insert("insert into items values(null,#{name},#{guige},#{xinghao},#{amount},#{beizhu})")
    Boolean InsertItem(Items items);
}
